package com.ruanyun.modular.admin.mapper;

import com.ruanyun.modular.admin.entity.TMonitoringinfo;
import com.ruanyun.modular.admin.model.params.TMonitoringinfoParam;
import com.ruanyun.modular.admin.model.result.TExhaustEquipmentResult;
import com.ruanyun.modular.admin.model.result.TMonitoringinfoResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 监测信息 Mapper 接口
 * </p>
 *
 * @author zs
 * @since 2021-04-19
 */
@Repository
public interface TMonitoringinfoMapper extends BaseMapper<TMonitoringinfo> {

    /**
     * 获取列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    List<TMonitoringinfoResult> customList(@Param("paramCondition") TMonitoringinfoParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TMonitoringinfoParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    Page<TMonitoringinfoResult> customPageList(@Param("page") Page page, @Param("paramCondition") TMonitoringinfoParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TMonitoringinfoParam paramCondition);


    Page<TMonitoringinfoResult> customPageList1(@Param("page") Page page, @Param("paramCondition") TMonitoringinfoParam paramCondition);


    /*根据companyId 查询是否存在数据*/
    @Select("SELECT * FROM t_monitoringinfo WHERE company_id = #{companyId}  and del_flag != 2")
    List<TMonitoringinfo> getDetails(@Param("companyId")Long companyId);

    @Select("select * from t_monitoringinfo where id = #{id} ")
    TMonitoringinfoResult getDetail(@Param("id") Integer id);

    Page<TMonitoringinfoResult> getMonitoringinfoPage(@Param("pageContext") Page pageContext, @Param("companyId") Integer companyId);


    @Select("select  *,monitoring_report as montioringPic from t_monitoringinfo   where  company_id = #{companyId} and del_flag != 2")
    List<TMonitoringinfoResult> getMonList(@Param("companyId") Integer companyId);
}
